linalg_inverse Module


Uses


Interfaces

public interface mtx_inverse

  • private pure function mtx_inverse_dbl(a) result(rst)

    Computes the inverse of a square matrix.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in), dimension(:,:) :: a

    The N-by-N matrix to invert.

    Return Value real(kind=real64), allocatable, dimension(:,:)

    The N-by-N inverted matrix.

  • private pure function mtx_inverse_cmplx(a) result(rst)

    Computes the inverse of a square matrix.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(in), dimension(:,:) :: a

    The N-by-N matrix to invert.

    Return Value complex(kind=real64), allocatable, dimension(:,:)

public interface mtx_pinverse

  • private pure function mtx_pinverse_dbl(a, tol) result(ainv)

    Computes the Moore-Penrose pseudo-inverse of a M-by-N matrix using the singular value decomposition of the matrix.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in), dimension(:,:) :: a

    The M-by-N matrix to invert.

    real(kind=real64), intent(in), optional :: tol

    An optional input, that if supplied, overrides the default tolerance on singular values such that singular values less than this tolerance are forced to have a reciprocal of zero, as opposed to 1/S(I). The default tolerance is: MAX(M, N) * EPS * MAX(S).

    Return Value real(kind=real64), allocatable, dimension(:,:)

    The N-by-M inverted matrix.

  • private pure function mtx_pinverse_cmplx(a, tol) result(ainv)

    Computes the Moore-Penrose pseudo-inverse of a M-by-N matrix using the singular value decomposition of the matrix.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(in), dimension(:,:) :: a

    The M-by-N matrix to invert.

    real(kind=real64), intent(in), optional :: tol

    An optional input, that if supplied, overrides the default tolerance on singular values such that singular values less than this tolerance are forced to have a reciprocal of zero, as opposed to 1/S(I). The default tolerance is: MAX(M, N) * EPS * MAX(S).

    Return Value complex(kind=real64), allocatable, dimension(:,:)

    The N-by-M inverted matrix.